<template>
	<view>

		<!-- train_enum_id == 1  短训培训班-->
		<!-- train_enum_id == 2 长训-->
		<!-- train_enum_id == 3 小班-->
		<view class="schedule" v-if="train_enum_id == 1">
			<view class="list" v-if="list.length">
				<view v-if="class_id == 0"
					:style="{ backgroundImage: `url(${assetsPath}${item.status === 3 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3' : 'fb1facf62d9a712f0f2d223b7156f4fac11443af'}.png)` }"
					class="item pr d-flex justify-space-between flex-column" v-for="(item,index) in list" :key="index"
					>
					<!-- <view class="list" >
			<view
				class="item pr d-flex justify-space-between flex-column"
				v-for="item in list"
				:key="item.id"
			> -->
			<!-- class_id >0 已排班     class_id =0 未排班-->
					<view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view class="section">第 {{ item.times }} 节课</view>
						<view class="status" style="font-size: 24rpx;">
							<!-- <view class="today pa flex-center" v-if="item.status === 1">今日上课</view> -->
							<view style="color: #999;" v-if="item.status === 1">已上课</view>
							<view style="color: #EB4751;" v-if="item.status === 2">请假</view>
							<view style="color: #EB4751;" v-if="item.status === 3">未上课</view>
						</view>
					</view>
					<!-- <view class="flex-between">
					<view class="section">第{{ item.class }}节课</view>
				</view> -->

					<!-- <view  class="time"  v-if="item.status === 1">
					<view class="booking pa">
						<image style="width: 73rpx;height: 73rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/12e1c8f988312fa831a94a57d0def1ca3cfd9f21.png" mode=""></image>
					</view>
				</view> -->
					<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view>
							<view class="date">{{ item.sku }}</view>
						</view>
					</view>
					<view class="flex-align">
						<view v-if="item.date && item.time">
							<view class="date" style="font-weight: 700;color: #000000;">{{ item.date }} {{ item.time }}</view>
							<!-- <view class="date">{{ item.date }}</view>
							<view class="time">{{ item.time }}</view> -->
						</view>
						<view v-else class="time">
							<!-- 暂未预约 -->
							<!-- <view class="booking pa">
							<u-button text="立即预约" shape="circle" color="linear-gradient(0deg, #528EFF, #2F75FA)" customStyle="width: 174rpx; height: 60rpx;" @click="yuyuelist"></u-button>
						</view> -->
							<view class="d-flex"  v-if="item.status != 1">
								<view
									style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
									<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
										<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
											width="52rpx" height="52rpx"></u-image>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="flex-align">
					<u-icon name="map-fill" color="#3b68ee"></u-icon>
					<view class="address">
						{{ item.address }}
					</view>
				</view> -->
				</view>
				<view  v-if="class_id > 0"
						:style="{ backgroundImage: `url(${assetsPath}${item.status === 3 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3' : 'fb1facf62d9a712f0f2d223b7156f4fac11443af'}.png)` }"
						class="item pr d-flex justify-space-between flex-column" v-for="(item,index) in list" :key="index"
						>
						<!-- <view class="list" >
				<view
					class="item pr d-flex justify-space-between flex-column"
					v-for="item in list"
					:key="item.id"
				> -->
				<!-- class_id >0 已排班     class_id =0 未排班-->
						<view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
							<view class="section">{{ item.class_hour_name }}</view>
							<view class="status" style="font-size: 24rpx;">
								<!-- <view class="today pa flex-center" v-if="item.status === 1">今日上课</view> -->
								<view style="color: #999;" v-if="item.status === 1">已上课</view>
								<view style="color: #EB4751;" v-if="item.status === 2">请假</view>
								<view style="color: #EB4751;" v-if="item.status === 3">未上课</view>
							</view>
						</view>
						<!-- <view class="flex-between">
						<view class="section">第{{ item.class }}节课</view>
					</view> -->
				
						<!-- <view  class="time"  v-if="item.status === 1">
						<view class="booking pa">
							<image style="width: 73rpx;height: 73rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/12e1c8f988312fa831a94a57d0def1ca3cfd9f21.png" mode=""></image>
						</view>
					</view> -->
						<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
							<!-- <view>
								<view class="date">{{ item.coach_name }}</view>
							</view> -->
							<view
								style="float: left; width: auto;height: 42rpx;background-color: #eefaf6;border-radius: 30rpx;margin-top: 0rpx;padding: 0rpx 20rpx; ">
								<view style="float: right;line-height: 42rpx;color: #1aa384;margin-right: 6rpx;font-size: 24rpx;">
									{{item.coach_name}}
								</view>
							</view>
						</view>
						<view class="flex-align">
							<view  @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
								<view class="date" style="font-weight: 700;color: #000000;">{{ item.record_date }} {{ item.time_period }}</view>
								<!-- <view class="date">{{ item.record_date }}</view>
								<view class="time">{{ item.time_period }}</view> -->
							</view>
							<view  class="time">
								<!-- 暂未预约 -->
								<!-- <view class="booking pa">
								<u-button text="立即预约" shape="circle" color="linear-gradient(0deg, #528EFF, #2F75FA)" customStyle="width: 174rpx; height: 60rpx;" @click="yuyuelist"></u-button>
							</view> -->
								<view class="d-flex"  v-if="item.status != 1">
									<view
										style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
										<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
											<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
												width="52rpx" height="52rpx"></u-image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<!-- <view class="flex-align">
						<u-icon name="map-fill" color="#3b68ee"></u-icon>
						<view class="address">
							{{ item.address }}
						</view>
					</view> -->
					</view>
			</view>

			<u-empty v-else text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" />
		</view>
		<!-- train_enum_id == 1  短训培训班-->
		<!-- train_enum_id == 2 长训-->
		<!-- train_enum_id == 3 小班-->
		<view class="schedule" v-if="train_enum_id == 2">
			<view class="list" v-if="list.length">
				<view
					:style="{ backgroundImage: `url(${assetsPath}${item.status === 3 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3'  :'fb1facf62d9a712f0f2d223b7156f4fac11443af'}.png)` }"
					class="item pr d-flex justify-space-between flex-column" v-for="(item,index) in list" :key="index">
					<!-- <view class="list" >
			<view
				class="item pr d-flex justify-space-between flex-column"
				v-for="item in list"
				:key="item.id"
			> -->
					<view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view class="section">{{ item.class_hour_name }}</view>
						<view class="status" style="font-size: 24rpx;">
							<!-- <view class="today pa flex-center" v-if="item.status === 1">今日上课</view> -->
							<view style="color: #999;" v-if="item.status === 1">已上课</view>
							<view style="color: #EB4751;" v-if="item.status === 2">请假</view>
							<view style="color: #EB4751;" v-if="item.status === 3">未上课</view>
						</view>
					</view>
					<!-- <view class="flex-between">
					<view class="section">第{{ item.class }}节课</view>
				</view> -->

					<!-- <view  class="time"  v-if="item.status === 1">
					<view class="booking pa">
						<image style="width: 73rpx;height: 73rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/12e1c8f988312fa831a94a57d0def1ca3cfd9f21.png" mode=""></image>
					</view>
				</view> -->
					<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<!-- <view>
							<view class="date">{{ item.coach_name }}</view>
						</view> -->
						<view
							style="float: left; width: auto;height: 42rpx;background-color: #eefaf6;border-radius: 30rpx;margin-top: 0rpx;padding: 0rpx 20rpx; ">
							<view style="float: right;line-height: 42rpx;color: #1aa384;margin-right: 6rpx;font-size: 24rpx;">
								{{item.coach_name}}
							</view>
						</view>
					</view>
					<view class="flex-align">
						<view  @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
							<view class="date" style="font-weight: 700;color: #000000;">{{ item.record_date }} {{ item.time_period }}</view>
							<!-- <view class="date">{{ item.record_date }}</view>
							<view class="time">{{ item.time_period }}</view> -->
						</view>
						<view class="time">
							<!-- 暂未预约 -->
						
							<view class="d-flex" v-if="item.status != 1">
								<view
									style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
									<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
										<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
											width="52rpx" height="52rpx"></u-image>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="flex-align">
					<u-icon name="map-fill" color="#3b68ee"></u-icon>
					<view class="address">
						{{ item.address }}
					</view>
				</view> -->
				</view>
			</view>

			<u-empty v-else text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" />
		</view>
		<!-- train_enum_id == 1  短训培训班-->
		<!-- train_enum_id == 2 长训-->
		<!-- train_enum_id == 3 小班 排课-->
		<!-- class_mode_id = 2 是排课模式 -->
		<view class="schedule" v-if="train_enum_id == 3 && class_mode_id == 1">
			<view class="list" v-if="list.length">
				<view
					:style="{ backgroundImage: `url(${assetsPath}${item.status === 3 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3' : 'fb1facf62d9a712f0f2d223b7156f4fac11443af' }.png)` }"
					class="item pr d-flex justify-space-between flex-column" v-for="(item,index) in list" :key="index">
					<!-- <view class="list" >
			<view
				class="item pr d-flex justify-space-between flex-column"
				v-for="item in list"
				:key="item.id"
			> -->
					<view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view class="section">{{item.class_hour_name}}</view>
						<view class="status" style="font-size: 24rpx;">
							<!-- <view class="today pa flex-center" v-if="item.status === 1">今日上课</view> -->
							<!-- <view style="color: #EB4751;" v-if="item.status === 0">待上课</view> -->
							<view style="color: #999;" v-if="item.status === 1">已上课</view>
							<view style="color: #EB4751;" v-if="item.status === 2">请假</view>
							<view style="color: #EB4751;" v-if="item.status === 3">未上课</view>
						</view>
					</view>
					<!-- <view class="flex-between">
					<view class="section">第{{ item.class }}节课</view>
				</view> -->

					<!-- <view  class="time"  v-if="item.status === 1">
					<view class="booking pa">
						<image style="width: 73rpx;height: 73rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/12e1c8f988312fa831a94a57d0def1ca3cfd9f21.png" mode=""></image>
					</view>
				</view> -->
					<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<!-- <view>
							<view class="date">{{ item.coach_name }}</view>
						</view> -->
						<view
							style="float: left; width: auto;height: 42rpx;background-color: #eefaf6;border-radius: 30rpx;margin-top: 0rpx;padding: 0rpx 20rpx; ">
							<view style="float: right;line-height: 42rpx;color: #1aa384;margin-right: 6rpx;font-size: 24rpx;">
								{{item.coach_name}}
							</view>
						</view>
					</view>
					<view class="flex-align">
						<view @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
							<view class="date" style="font-weight: 700;color: #000000;">{{ item.record_date }} {{ item.time_period }}</view>
							<!-- <view class="date">{{ item.record_date }}</view>
							<view class="time">{{ item.time_period }}</view> -->
						</view>
						<view class="time">
							<!-- 暂未预约 -->

							<view class="d-flex"  v-if="item.status != 1">
								<view
									style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
									<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
										<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
											width="52rpx" height="52rpx"></u-image>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="flex-align">
					<u-icon name="map-fill" color="#3b68ee"></u-icon>
					<view class="address">
						{{ item.address }}
					</view>
				</view> -->
				</view>
			</view>

			<u-empty v-else text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" />
		</view>
		<!-- train_enum_id == 1  短训培训班-->
		<!-- train_enum_id == 2 长训-->
		<!-- train_enum_id == 3 小班 约课-->
		<!-- is_appointment      1 未约课 2 已约课 -->
		<!-- class_mode_id = 2 是约课模式 -->
		<view class="schedule" v-if="train_enum_id == 3 && class_mode_id == 2">
			<view class="list" v-if="list.length">
				<view
					:style="{ backgroundImage: `url(${assetsPath}${item.status == 3 && item.is_appointment == 1 ? '07ae6e77c3bc8765b750ad7b679c8c2c14cc1c92' : item.status == 3 && item.is_appointment == 2 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3' : 'fb1facf62d9a712f0f2d223b7156f4fac11443af'}.png)` }"
					class="item pr d-flex justify-space-between flex-column" v-for="(item,index) in list" :key="index">
					<!-- <view class="list" >
			<view
				class="item pr d-flex justify-space-between flex-column"
				v-for="item in list"
				:key="item.id"
			> -->
					<view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view class="section">{{ item.class_hour_name }}</view>
						<view class="status" style="font-size: 24rpx;">
							<!-- <view class="today pa flex-center" v-if="item.status === 1">今日上课</view> -->
							<!-- <view style="color: #EB4751;" v-if="item.status === 0">待上课</view> -->
							<view style="color: #EB4751;" v-if="item.status == 3 && item.is_appointment == 1">未约课</view>
							<view style="color: #EB4751;" v-if="item.status == 3 && item.is_appointment == 2">未上课</view>
							<view style="color: #EB4751;" v-if="item.status == 2">请假</view>
							<view style="color: #999;" v-if="item.status == 1">已上课</view>
						</view>
					</view>
					<!-- <view class="flex-between">
					<view class="section">第{{ item.class }}节课</view>
				</view> -->

					<!-- <view  class="time"  v-if="item.status === 1">
					<view class="booking pa">
						<image style="width: 73rpx;height: 73rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/12e1c8f988312fa831a94a57d0def1ca3cfd9f21.png" mode=""></image>
					</view>
				</view> -->
					<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<!-- <view>
							<view class="date">{{ item.coach_name }}</view>
						</view> -->
						<view
							style="float: left; width: auto;height: 42rpx;background-color: #eefaf6;border-radius: 30rpx;margin-top: 0rpx;padding: 0rpx 20rpx; ">
							<view style="float: right;line-height: 42rpx;color: #1aa384;margin-right: 6rpx;font-size: 24rpx;">
								{{item.coach_name}}
							</view>
						</view>
					</view>
					<view class="flex-align">
						<view @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
							<view class="date" style="font-weight: 700;color: #000000;">{{ item.record_date }} {{ item.time_period }}</view>
							<view class="time"></view>
						</view>
						<view class="time">
							<!-- 暂未预约 -->
							<view class="booking pa" v-if="item.is_appointment == 1">
								<u-button text="立即预约" shape="circle" color="linear-gradient(0deg, #528EFF, #2F75FA)"
									customStyle="width: 174rpx; height: 60rpx;" @click="yuyuelist(goods_id,train_item_id,item)"></u-button>
							</view>
							<view class="d-flex"  v-if="item.is_appointment == 2 && item.status != 1">
								<view
									style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
									<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
										<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
											width="52rpx" height="52rpx"></u-image>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="flex-align">
					<u-icon name="map-fill" color="#3b68ee"></u-icon>
					<view class="address">
						{{ item.address }}
					</view>
				</view> -->
				</view>
			</view>

			<u-empty v-else text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" />
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: Array,
			train_enum_id: {
				//参数名
				type: String, //参数名
			},
			class_mode_id: {
				//参数名
				type: String, //参数名
			},
			train_item_id: {
				//参数名
				type: String, //参数名
			},
			goods_id: {
				//参数名
				type: String, //参数名
			},
			student_id: {
				//参数名
				type: String, //参数名
			},
			class_id: {
				//参数名
				type: String, //参数名
			},
		},
		// props:['infos'],
		data() {
			return {
				assetsPath: this.$https.assetsPath,
			}
		},
		computed: {},
		onLoad() {},
		methods: {
			yuyuelist(goods_id,train_item_id,item) {
				console.log(train_item_id,item,'555')
				uni.navigateTo({
					url: './appointment?train_item_id=' + train_item_id + '&coach_name=' + item.coach_name + '&class_hour_name=' + item.class_hour_name + '&coach_id=' + item.coach_id + '&class_record_id=' + item.id  + '&student_name=' + item.student_name ,
				})
			},
			onclick(item,train_enum_id,class_mode_id,train_item_id) {
				console.log(item,train_enum_id,class_mode_id,'1212')
				// <!-- train_enum_id == 1  短训培训班-->
				// <!-- train_enum_id == 2 长训-->
				// <!-- train_enum_id == 3 小班 约课-->
				// class_mode_id = 2 是约课模式
				// is_appointment      1 未约课 2 已约课
				// status课务状态 1已上课 2请假 3 未上课
				if (train_enum_id == 3 && class_mode_id == 2) {
					uni.navigateTo({
						url: './class_appointment?id=' + item.id+ '&train_item_id=' + train_item_id,//预约中
					})
				} else{
					uni.navigateTo({
						url: './class_today?id=' + item.id, //进行中
					})
					// if (item.status === 3) {
					// 	uni.navigateTo({
					// 		url: './class_appointment',//预约中
					// 	})
					// } else if (item.status === 4) {
					// 	uni.navigateTo({
					// 		url: './class_lass', //已上课
					// 	})
					// } else if (item.status === 2) {
					// 	uni.navigateTo({
					// 		url: './class_taught',//待上课
					// 	})
					// } else if (item.status === 1) {
					// 	uni.navigateTo({
					// 		url: './class_today', //进行中
					// 	})
					// }
				}
				
			},
			onClickewm(student_id,train_enum_id,goods_id,item) {
				// <!-- train_enum_id == 1  短训培训班-->
				// <!-- train_enum_id == 2 长训-->
				// <!-- train_enum_id == 3 小班-->
				if (train_enum_id == 1) {
					uni.navigateTo({
						url: '../lesson_code?student_id=' + student_id + '&goods_id=' + goods_id + '&id=' + item.id,
					});
				} else{
					uni.navigateTo({
						url: '../lesson_code?student_id=' + item.student_id + '&goods_id=' + goods_id + '&id=' + item.id,
					});
				}
				
				
			},
		}

	}
</script>

<style lang="scss" scoped>
	.schedule {
		padding: 30rpx;

		.list {
			.item {
				border-radius: 20rpx;
				// background: rgb(227,228,251);
				// height: 100%;
				// /* background: url(/static/lanhu_jifenzhuanqu/ps5nuv51mzloe7ybzpwod18la38bhkjjkk4278f36e6-182b-4d49-a296-e7919f1c5f46.png) 100% no-repeat; */
				background-size: 100% 100%;
				// width: 750rpx;
				padding: 20rpx;
				height: 200rpx;
				width: 690rpx;

				&+.item {
					margin-top: 30rpx;
				}

				.section {
					background-color: rgba(85, 190, 243, 0.1);
					border-radius: 21rpx;
					padding: 9rpx 22rpx;
					color: #333333;
					font-size: 24rpx;
				}

				.today {
					right: 0;
					top: 15rpx;
					background: #FA4C4C;
					border-radius: 26rpx 0px 0px 26rpx;
					width: 144rpx;
					height: 52rpx;
					font-size: 26rpx;
					color: #fff;
				}

				.date {
					color: #999999;
					font-size: 24rpx;
				}

				.time {
					color: #333333;
					font-size: 24rpx;
				}

				.booking {
					right: 20rpx;
					bottom: 20rpx;
				}

				.address {
					color: #999999;
					font-size: 20rpx;
				}
			}
		}
	}
</style>
